import http from '@/utils/http';

// 操作日志记录函数
export const recordOperation = async (operation) => {
  try {
    const response = await http.post('/logs', { operation });
    console.log('Operation logged:', response);
  } catch (error) {
    console.error('Error logging operation:', error);
  }
};

// 获取日志列表的函数
export const fetchLogData = async () => {
  try {
    const response = await http.get('/logs');
    return response.logs;
  } catch (error) {
    console.error('Error fetching log data:', error);
    throw error;
  }
};
